﻿using System;
using System.IO;
using System.Security;

class PutLineNumbers
{
    static void Main()
    {
        try
        {
            using (StreamReader readFile = new StreamReader("C:\\WINDOWS\\win.ini"))
            {
                using (StreamWriter outputFile = new StreamWriter("output.txt"))
                {
                    string currentLine;
                    int lineCounter = 1;

                    while ((currentLine = readFile.ReadLine()) != null)
                    {
                        outputFile.WriteLine(lineCounter + ". " + currentLine);
                        lineCounter++;
                    }
                }
            }
        }
        catch (FileNotFoundException)
        {
            Console.WriteLine("Cannot find the file");
        }
        catch (DirectoryNotFoundException)
        {
            Console.WriteLine("Invalid Folder ");
        }
        catch (PathTooLongException)
        {
            Console.WriteLine("The path is too long");
        }
        catch (UnauthorizedAccessException)
        {
            Console.WriteLine("You don`t have access!");
        }
        catch (NotSupportedException)
        {
            Console.WriteLine("Cannot open this file!");
        }
        catch (SecurityException)
        {
            Console.WriteLine("Not enough permission to open file!");
        }
    }
}